<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>新增会员等级</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_memberAdd.css">
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
</head>

<body>
<div class="page_wraper">
	<div id="tab1_0" fortab="tab1">
		<form action="" method="post" id="memberAdd_form">
			<table cellpadding="0" cellspacing="0" class="module_form" width="600">
			<tr>
				<td class="ele_title"><label for="title">会员等级名称：<em>*</em></label></td>
				<td class="ele_content">
					<input name="title" type="text" id="title" class="form_ele_text width_200">
				</td>
				<td class="ele_title"><label for="prefix">会员等级前缀：<em>*</em></label></td>
				<td class="ele_content">
					<input name="prefix" type="text" id="prefix" class="form_ele_text width_200">
				</td>
			</tr>
			<tr>
				<td class="ele_title"><label for="init_jifen">初始赠送积分：</label></td>
				<td class="ele_content">
					<input name="init_jifen" type="text" id="init_jifen" class="form_ele_text width_200"></td>
				<td class="ele_title"><label for="init_money">初始赠送金额：</label></td>
				<td class="ele_content">
					<input name="init_money" type="text" id="init_money" class="form_ele_text width_200"></td>
			</tr>
			<tr>
				<td class="ele_title"><label for="discount">会员等级折扣：<em>*</em></label></td>
				<td class="ele_content">
					<input name="discount" type="text" id="discount" class="form_ele_text width_200">
				</td>
				<td class="ele_title"><label for="privileged">会员等级特权：</label></td>
				<td class="ele_content">
					<textarea style="width:300px;height:80px;" name="privileged" id="privileged"></textarea>
				</td>
			</tr>
		</table>
		</form>
	</div>
</div>
<div class="page_footer pdtd10">
	<input type="button" name="submit" value="确认添加"  class="form_ele_submit"/>
	<input type="reset"  name="reset"  value="重置表单"  class="form_ele_reset"/>
</div>
</body>
<script type="text/javascript">
//弹出窗口全局变量
var api = frameElement.api, W = api.opener;

$(function(){
	
	//重置
	$('.form_ele_reset').on('click',function(){
		$('#memberAdd_form').get(0).reset();
	});
	
	//提交
	$('.form_ele_submit').on('click',function(){
		
		var tipsObj = windowApi.lhgdialog.tips('正在提交数据...',10,etIcon.loading);
		
		//通过Ajax提交表单
		var postData = {};
		postData.title       =  $('#title').val(); 
		postData.prefix      =  $('#prefix').val();
		postData.discount    =  $('#discount').val(); 
		postData.attr        =  $('#attr').val(); 
		postData.init_jifen  =  $('#init_jifen').val();
		postData.init_money  =  $('#init_money').val(); 
		postData.privileged  =  $('#privileged').val(); 
		postData.instruction =  $('#instruction').val(); 
		
		//console.log(postData);
		
		$.post("{:U('Custom/levelAdd')}", postData ,function(data){
			if(data.status==1){
				windowApi.lhgdialog.tips('数据修改成功！');
				var obj = windowApi.lhgdialog.list['Custom_level'];
				obj.reload(obj);
				frameApi.close(); //关闭当前窗口
			}else{
				windowApi.lhgdialog.alert(data.info);
			}
		});
	});
});
</script>
</html>
